package com.example.design.shejimoshi.action.strategy.spring01;

import com.example.design.shejimoshi.action.strategy.spring01.dto.ExecutorDTO;
import com.example.design.shejimoshi.action.strategy.spring01.dto.MessageExecutorDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@RestController
public class StrategySpringTest01 {
    @Resource
    LinkExecutorHolder linkExecutorHolder;
    
    @GetMapping("/strategySpringTest01")
    public void strategySpringTest01(){
        List<ExecutorDTO> linkExecutors = new ArrayList<>();
        MessageExecutorDTO executorDTO = new MessageExecutorDTO();
        executorDTO.setExecutorType("messageService");
        executorDTO.setId(1L);
        linkExecutors.add(executorDTO);
        linkExecutorHolder.execute(linkExecutors);
    }
}
